package parser

import (
	"errors"
	"project/schedule/model"
)

func ParseProjectScale(general *model.General, body *map[string]interface{}) error {
	projectScale, ok := (*body)["projectScale"]
	if !ok {
		return errors.New("no projectScale in body")
	}
	for week, weekInfo := range projectScale.(map[string]interface{}) {
		general.ProjectScale[week] = weekInfo.(string)
	}
	return nil
}
